<script>
	var app = require('./utils/api.js');
	var QQMapWX = require('./utils/qqmap-wx-jssdk.min.js');
	var qqmapsdk = '';
	export default {
		data() {
			return {};
		},
		onLaunch: function(options) {
			var that = this;
			////console.log(options);
			// init(options);
			this.globalData.sysinfo = uni.getSystemInfoSync();
			uni.getSystemInfo({
				success: function(res) {
					that.globalData.statusBarHeight = res.statusBarHeight * 1 + 46;
					that.globalData.statusBarHeight1 = res.statusBarHeight;
				}
			});
			
		},
		globalData: {
			uid: '',
			img_src: 'https://mmchengren.com/ctimg/',
			img_urls: 'https://mmchengren.com/',
			imgoss:'https://mmchengren.fss-my.addlink.cn/',
			screenWidth: uni.getSystemInfoSync().screenWidth,
			screenHeight: uni.getSystemInfoSync().screenHeight,
			api: app,
			wsUrl: 'wss://kaoyan.xihenet.net',
			show: function(str) {
				uni.showToast({
					title: str,
					icon: 'none',
					//仅支持success或者loading
					duration: 2000
				});
			},
			d: function(str, num) {
				uni.showToast({
					title: str,
					icon: 'none',
					duration: 2000,
					success: function() {
						setTimeout(function() {
							uni.navigateBack({
								delta: num ? 2 : 1,
								// 返回上一级页面。
								success: function() {
									////console.log('成功！');
								}
							});
						}, 1000);
					}
				});
			},
			Urbaninquiry:function(callback = null){
				//console.log(1)
					uni.getLocation({
						altitude: true,
						type: 'gcj02',
						success: function(res) {
							var latitude = res.latitude;
							var longitude = res.longitude;
							var location = {
								latitude: latitude,
								longitude: longitude
							}
							let that = this
							// 高德逆地理变码 https://lbs.amap.com/api/webservice/guide/api/georegeo/
							let _key = 'c62bde12b410b83b52f027bb403d9fef'; //高德API key类型：web服务
							uni.request({
								method: 'GET',
								url: 'https://restapi.amap.com/v3/geocode/regeo?parameters',
								data: {
									key: _key,
									location: `${longitude},${latitude}`,
									output: 'JSON'
								},
								success: async (res) => {
									//console.log(res)
									uni.setStorageSync('lat', latitude);
									uni.setStorageSync('lng', longitude);
									uni.setStorageSync('city', res.data.regeocode.formatted_address);
									var pages = getCurrentPages();
									var currentPage = pages[pages.length - 1]
									// currentPage.$vm.province = cityInfo.province
									currentPage.$vm.city = res.data.regeocode.formatted_address
									// currentPage.$vm.area = cityInfo.district
									
									if (callback != null) callback(res)
									uni.hideLoading();
									//用户所在的地理位置信息
								},
								fail: r => {
									//console.log(r);
									if (callback != null) callback()
								}
							});
						},
						fail: function(res) {
							app.globalData.show('地址获取失败')
							if (callback != null) callback()
						},
					});
			},
			getModel: function() {
				//获取手机型号
				return this.sysinfo['model'];
			},
			getVersion: function() {
				//获取微信版本号
				return this.sysinfo['version'];
			},
			getSystem: function() {
				//获取操作系统版本
				return this.sysinfo['system'];
			},
			getPlatform: function() {
				//获取客户端平台
				return this.sysinfo['platform'];
			},
			getSDKVersion: function() {
				//获取客户端基础库版本
				return this.sysinfo['SDKVersion'];
			},
			BLEInformation: {
				platform: '',
				deviceId: '',
				writeCharaterId: '',
				writeServiceId: '',
				notifyCharaterId: '',
				notifyServiceId: '',
				readCharaterId: '',
				readServiceId: ''
			},

			util: require('./utils/util.js'),
			sysinfo: ''
		}
	};
	const updateManager = uni.getUpdateManager();
	updateManager.onCheckForUpdate(function(res) {
		// 请求完新版本信息的回调
	});
	updateManager.onUpdateReady(function() {
		updateManager.applyUpdate();
	});
	updateManager.onUpdateFailed(function() {
		// 新版本下载失败
	});
</script>
<style>
	scroll-view ::-webkit-scrollbar { display: none; }
	.yhytxt {
		width: 100%;
		height: auto;
		display: table;
		font-size: 16px;
		color: #222;
		text-align: center;
		line-height: 40px;
	}

	.body {
		width: 100%;
		height: 100%;
		/* background-color: #EFEFF4; */
	}

	.mg-t-10 {
		margin-top: 10rpx;
	}

	.mg-t-20 {
		margin-top: 20rpx;
	}

	.mg-t-30 {
		margin-top: 30rpx;
	}

	.mg-t-40 {
		margin-top: 40rpx;
	}

	.mg-t-50 {
		margin-top: 50rpx;
	}

	.mg-top-60 {
		margin-top: 60rpx;
	}

	.mg-t-70 {
		margin-top: 70rpx;
	}

	.mg-t-80 {
		margin-top: 80rpx;
	}

	.mg-t-90 {
		margin-top: 90rpx;
	}

	.mg-t-100 {
		margin-top: 100rpx;
	}

	.mg-l-10 {
		margin-left: 10rpx;
	}

	.mg-l-16 {
		margin-left: 16rpx;
	}

	.mg-l-20 {
		margin-left: 20rpx;
	}

	.mg-l-30 {
		margin-left: 30rpx;
	}

	.mg-l-40 {
		margin-left: 40rpx;
	}

	.mg-l-10 {
		margin-left: 10rpx;
	}

	.mg-l-50 {
		margin-left: 50rpx;
	}

	.mg-l-56 {
		margin-left: 56rpx;
	}

	.mg-l-60 {
		margin-left: 60rpx;
	}

	.mg-l-70 {
		margin-left: 70rpx;
	}

	.mg-l-80 {
		margin-left: 80rpx;
	}

	.mg-l-90 {
		margin-left: 90rpx;
	}

	.mg-l-100 {
		margin-left: 100rpx;
	}

	.mg-b-10 {
		margin-left: 10rpx;
	}

	.mg-b-10 {
		margin-left: 10rpx;
	}

	.mg-b-20 {
		margin-left: 20rpx;
	}

	.mg-b-30 {
		margin-left: 30rpx;
	}

	.mg-b-40 {
		margin-left: 40rpx;
	}

	.mg-b-10 {
		margin-left: 10rpx;
	}

	.mg-b-50 {
		margin-left: 50rpx;
	}

	.mg-b-60 {
		margin-left: 60rpx;
	}

	.mg-b-70 {
		margin-left: 70rpx;
	}

	.mg-b-80 {
		margin-left: 80rpx;
	}

	.mg-b-90 {
		margin-left: 90rpx;
	}

	.mg-b-100 {
		margin-left: 100rpx;
	}

	.t-flex-row {
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}

	.t-flex-row-sa {
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
	}

	.t-flex-row-sb {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.t-flex-row-s {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}

	.t-flex-row-s-s {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: flex-start;
	}

	.t-flex-row-s-e {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: flex-end;
	}

	.t-flex-row-e {
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
		align-items: center;
		line-height: 60rpx;
	}

	.t-flex-col {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.t-flex-col-sa {
		display: flex;
		justify-content: space-around;
		align-items: center;
	}

	.t-flex-col-sb {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
	}

	.t-flex-col-s {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
	}

	.t-flex-col-s-s {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: flex-start;
	}

	.t-flex-col-s-e {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: flex-end;
	}

	.t-flex-col-e {
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		align-items: center;
	}

	.t-click-class {
		opacity: 0.5;
	}

	.t-click-wclass {
		background: rgba(151, 151, 151, 0.3);
	}

	.t-text-oneline {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.t-text-twoline {
		display: -webkit-box;
		word-break: break-all;
		text-overflow: ellipsis;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.t-text-threeline {
		display: -webkit-box;
		word-break: break-all;
		text-overflow: ellipsis;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
	}

	.load_more {
		text-align: center;
		font-size: 28rpx;
		line-height: 40rpx;
		text-decoration: underline;
		margin: 1.5em auto;
		color: #7c7c7c;
	}

	.load_nomore {
		text-align: center;
		font-size: 26rpx;
		line-height: 40rpx;
		margin: 1.5em auto;
		color: #7c7c7c;
	}

	.weui-loading {
		margin: 0 5px;
		width: 20px;
		height: 20px;
		display: inline-block;
		vertical-align: middle;
		-webkit-animation: a 1s steps(12) infinite;
		animation: a 1s steps(12) infinite;
		background: transparent url() no-repeat;
		background-size: 100%;
	}

	.weui-loadmore {
		width: 65%;
		margin: 1.5em auto;
		line-height: 1.6em;
		font-size: 14px;
		text-align: center;
	}

	.weui-loadmore__tips {
		display: inline-block;
		vertical-align: middle;
	}

	.weui-loadmore_line {
		border-top: 1px solid #e5e5e5;
		margin-top: 2.4em;
	}

	.weui-loadmore__tips_in-line {
		position: relative;
		top: -0.9em;
		padding: 0 0.55em;
		background-color: #fff;
		color: #999;
	}

	@-webkit-keyframes a {
		0% {
			-webkit-transform: rotate(0deg);
			transform: rotate(0deg);
		}

		to {
			-webkit-transform: rotate(1turn);
			transform: rotate(1turn);
		}
	}

	@keyframes a {
		0% {
			-webkit-transform: rotate(0deg);
			transform: rotate(0deg);
		}

		to {
			-webkit-transform: rotate(1turn);
			transform: rotate(1turn);
		}
	}

	.t-self-loading {
		position: fixed;
		z-index: 100;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
	}

	.t-self-zhezhao {
		position: fixed;
		z-index: 101;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
	}

	.t-self-loading-icon {
		width: 54rpx;
		height: 54rpx;
		margin-top: calc((100% - 54rpx) / 2);
		margin-left: calc((100% - 54rpx) / 2);
	}

	.t-my-opt-hc {
		background: #dfdfdf !important;
	}

	.t-cancle-btn {
		font-size: 30rpx;
		color: #272727;
		font-weight: bold;
	}

	.t-confrim-btn {
		font-size: 30rpx;
		color: #596996;
		font-weight: bold;
	}

	.weui-dialog__title {
		font-size: 30rpx;
		color: #259f38;
	}

	.weui-dialog__bd {
		font-size: 30rpx;
		color: #272727;
	}

	.t-bd-dialog {
		height: 422rpx;
	}

	.t-item-click {
		background: #dfdfdf !important;
	}

	.t-dag .weui-dialog {
		margin: 0 !important;
		width: 580rpx !important;
		height: 332rpx !important;
		border-radius: 20rpx !important;
	}

	.t-dag .weui-dialog__hd {
		padding: 60rpx 0rpx 0rpx 0rpx !important;
		line-height: 42rpx !important;
	}

	.t-dag .weui-dialog__title {
		font-size: 30rpx !important;
		color: #259f38 !important;
	}

	.t-dag .weui-dialog__bd {
		font-size: 30rpx !important;
		color: #272727 !important;
		line-height: 42rpx !important;
		height: 80rpx !important;
		margin-bottom: 0rpx !important;
		overflow: hidden;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		text-align: left;
	}

	.t-dag .weui-dialog__ft {
		height: 100rpx !important;
		line-height: 100rpx !important;
		min-height: 100rpx !important;
		box-sizing: border-box;
		font-size: 30rpx !important;
	}

	/**app.wxss**/
	.container {
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
	}
	
	.morder {
		width: auto;
		height: 30px;
		display: table;
		margin: auto;
		font-size: 12px;
		font-family: PingFang;
		font-weight: bold;
		color: #c9ced5;
		line-height: 30px;
		opacity: 0.91;
		position: relative;
		margin-bottom: 10px;
		margin-top: 12px;
	}

	.morder::before {
		content: '';
		width: 30px;
		height: 1px;
		display: inline-block;
		background: #b0b2b5;
		opacity: 0.3;
		position: absolute;
		top: 50%;
		margin-top: -0.5px;
		left: -40px;
	}

	.morder::after {
		content: '';
		width: 30px;
		height: 1px;
		display: inline-block;
		background: #b0b2b5;
		opacity: 0.3;
		position: absolute;
		top: 50%;
		margin-top: -0.5px;
		right: -40px;
	}

	.more {
		width: 73%;
		height: auto;
		display: table;
		text-align: center;
		line-height: 30px;
		position: fixed;
		right: 0px;
		bottom: 60px;
		font-size: 14px;
		background-color: #fff;
	}

	.patsx {
		width: 100%;
		height: auto;
		display: table;
		padding-bottom: 150px;
	}
	.weixin-tip{
	    width: 100%;
	    height: 100vh;
	    position: fixed;
	    top: 0px;
	    left: 0px;
	    background: rgba(0,0,0,0.9);
	    z-index: 100;
	}
	.weixin-tip>image{
	    width: 100%;
	    height: auto;
	}
</style>